package edu.sctu.lab03;

import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by Administrator on 2018/5/28.
 */
public class UserLIstServlet extends HttpServlet{
    @Override
    protected void doGet(HttpServlet rep,HttpServletResponse,resp)
        throws ServletException,IOException{

//        resp.setHeader("content-type","text/html;charset=UTF-8");
//
//        PrintWriter.out=resp.getWriter();

//        out.writer("<table>");
//        out.writer("<tr>");
//        out.writer("<td>编号</td>");
//        out.writer("<td>用户名</td>");
//        out.writer("<td>密码</td>");
//        out.writer("<td>操作1</td>");
//        out.writer("<td>操作2</td>");
//        out.writer("</tr>");
//        out.writer("<tr>");
//        out.writer("<td>1000</td>");
//        out.writer("<td>liu</td>");
//        out.writer("<td>123</td>");
//        out.writer("<td>删除</td>");
//        out.writer("<td>更新</td>");
//        out.writer("</tr>");
//        out.writer("</table>");
        Database database=new Darabaese();
        List<User>userList=satabase.getUserLIst();

        request.setAttribute("userList",userList);

        request.getResquestDispatcher("/userList.jsp").forward(request.reqponse);
    }

}
